<template>
  <div>
    <top  v-show=" show"/>
    <router-view></router-view>
    <goodsFooter :total="total" v-show="show"/>
  </div>
</template>

<script>
import top from "./top";
import center from "./center";
import goodsFooter from "./goodsFooter";
// 获取home页面数据方法引进
import { getorderApi } from "@/api/homeApi";
export default {
  data() {
    return {
      orderArr: [],
      page:1,
      pagesize:100,
      total:0,
      show:true
    };
  },
  components: {
    top,
    center,
    goodsFooter,
  },
  mounted() {
    this.getOrderList(); //发送请求 获取订单表格数据
    this.$bus.$on('changePage',this.getOrderList)
    this.$bus.$on('changePageSize',this.getOrderList)
    this.$rout
  },
  beforeDestroy(){
    this.$bus.$off('changePage')
    this.$bus.$off('changePageSize')

  },
  methods: {
    getOrderList() {
        var paramsObj ={
          page:this.page,
          pagesize:this.pagesize
        }
      getorderApi(paramsObj).then((res) => {
        
        if (res.code == 200) {
          // this.orderArr = res.data;
          this.total = res.total
          this.$store.commit('getOrderList',res.data)
        }
      });
    },

    
  },
};
</script>

<style  scoped>
</style>